'use strict';

const Service = require('egg').Service;

class LoginService extends Service {
  async select(name) {
        //创建查询sql语句
    let sqlStr = 'select * from user where user_name=?';
    let parmas = [name];
    //执行sql语句
    let res = await this.app.mysql.query(sqlStr,parmas);
    return res[0];
  }
 
}

module.exports = LoginService;
